<?xml version="1.0"?>

<f:view
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:liferay-ui="http://portletfaces.org/liferayfaces/liferay-ui"
	xmlns:liferay-util="http://portletfaces.org/liferayfaces/liferay-util"
	xmlns:ui="http://java.sun.com/jsf/facelets"
>
	<h:head />
	<h:body>
	<ice:form>
		<ice:panelGrid id="carta" columns="2">
			<ice:commandButton id="addTipo" action="#{cartaBean.addTipo()}" rendered="#{cartaBean.badministrador}" value="Tipo"/>
			<ice:commandButton id="addPlato" action="#{cartaBean.addPlato()}" rendered="#{cartaBean.badministrador}" value="Plato"/>
			<ice:dataTable id="menu" var="tipo" value="#{cartaBean.tipos}">
				<ice:rowSelector selectionListener="#{cartaBean.selectionListener}">
				<ice:column>
					<ice:outputText value="#{tipo.nombre}" />
					<ice:commandButton id="editTipo" action="#{cartaBean.editTipo(tipo)}" rendered="#{cartaBean.badministrador}"/>
				</ice:column>
				</ice:rowSelector>
			</ice:dataTable>
			<ice:dataTable id="principal" var="plato" value="#{cartaBean.platos}">
				<ice:column>
					<img src="#{plato.imageName}" alt="" width="50px" height="50px"/>
					<ice:commandButton id="editPlato" action="#{cartaBean.editPlato(plato)}" rendered="#{cartaBean.badministrador}"/>
				</ice:column>
				<ice:column>
					<ice:outputText value="#{plato.nombre}"/>
					<br/>
					<ice:outputText value="#{plato.descripcion}"/>
				</ice:column>
			</ice:dataTable>
			<ice:column/>
			<ice:dataPaginator id="paginator"
                               for="principal" 
                               fastStep="2"
                               paginator="true"
                               paginatorMaxPages="3">
                <f:facet name="first">
                    <h:graphicImage value="/xmlhttp/css/rime/css-images/arrow-first.gif"
                                    style="width: 18px; height: 18px; border: none;"
                                    alt="First" title="First"/>
                </f:facet>
                <f:facet name="last">
                    <h:graphicImage value="/xmlhttp/css/rime/css-images/arrow-last.gif"
                                    style="width: 18px; height: 18px; border: none;"
                                    alt="Last" title="Last"/>
                </f:facet>
                <f:facet name="previous">
                    <h:graphicImage value="/xmlhttp/css/rime/css-images/arrow-previous.gif"
                                    style="width: 18px; height: 18px; border: none;"
                                    alt="Previous" title="Previous"/>
                </f:facet>
                <f:facet name="next">
                    <h:graphicImage value="/xmlhttp/css/rime/css-images/arrow-next.gif"
                                    style="width: 18px; height: 18px; border: none;"
                                    alt="Next" title="Next"/>
                </f:facet>
            </ice:dataPaginator>
		</ice:panelGrid>
	</ice:form>	
	</h:body>
</f:view>